package cn.hzking.gjmall.adpters.car;

import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

import cn.hzking.gjmall.R;
import cn.hzking.gjmall.net.base.BaseEntity;

/**
 * Created by Administrator on 2018/2/28.
 */

public class CarListAdapter extends BaseQuickAdapter<BaseEntity,BaseViewHolder>{
    public CarListAdapter(int layoutResId, @Nullable List<BaseEntity> data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, BaseEntity item) {
        RecyclerView swipeMenuRecyclerView = helper.getView(R.id.car_item_rv);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        CarSecondListAdapter carSecondListAdapter = new CarSecondListAdapter(R.layout.item_car_goods_item);
        swipeMenuRecyclerView.setLayoutManager(linearLayoutManager);
        swipeMenuRecyclerView.setAdapter(carSecondListAdapter);
        ArrayList<BaseEntity> baseEntities = new ArrayList<>();
        baseEntities.add(new BaseEntity());
        baseEntities.add(new BaseEntity());
        carSecondListAdapter.setNewData(baseEntities);

    }
}
